home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 1 / Eagles_Nest_Mac_Collection_Disc_1.TOAST / HyperCard & XCMD⁄XFCN / HamNovTest41 / Novice Ham Test / background_2209.txt < prev    next >
Text File  |  1993-04-11  |  7KB  |  232 lines

  1. -- background: 2209 from stack: in
  2. -- bmap block id: 4402
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: intro
  6. ----- HyperTalk script -----
  7. on buildList -- ‚Ä¢‚Ä¢‚Ä¢ rename to buildList1 if using sequential questions
  8.   -- or to buildList if using randomly-generated questions
  9.   global questlist,rightone,lockkey,questans,questkey
  10.   global sky1, sky2, sky3, sky4, sky5, sky6 -- used for saved ans key
  11.   -- initialization
  12.   set the cursor to 4
  13.   -- ‚Ä¢‚Ä¢‚Ä¢questgrp contains the number of questions in each question group
  14.   -- and is used to generate random questions, one from each group.
  15.   -- Note that the question groups MUST BE sequential in order for this
  16.   -- to work.  That is, group 1 must be the first 10 questions, group 2
  17.   -- must be the next 14 questions, and so on.
  18.   put "11,11,11,11,14,11,11,11,11,11," into questgrp
  19.   put "20,15,12,11,11,11,11,11,11,11," after questgrp
  20.   put "11,12,11,13,11,11,11,11,11,11" after questgrp
  21.   -- ‚Ä¢‚Ä¢‚Ä¢ The number of commas in questans and questkey must be equal to
  22.   -- number of questions in each test minus one.  For example, for a
  23.   -- 30-question test, there are 29 commas.
  24.   put ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," into questans
  25.   put ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," into questkey
  26.   put empty into questlist
  27.   put 0 into startgroup
  28.   put empty into sky1
  29.   put empty into sky2
  30.   put empty into sky3
  31.   put empty into sky4
  32.   put empty into sky5
  33.   put empty into sky6
  34.   set lockscreen to true
  35.   -- generate the questions from subgroups randomly
  36.   repeat with i = 1 to number of items of questgrp
  37.     put startgroup into thisquest
  38.     add the random of item i of questgrp to thisquest
  39.     put questlist & "#" & thisquest & "," into questlist
  40.     add item i of questgrp to startgroup
  41.   end repeat
  42.   delete last character of questlist
  43.   -- ‚Ä¢‚Ä¢‚Ä¢ generate the answer key for these questions.  this currently
  44.   -- only handles up to first 51 questions.
  45.   repeat with i = 1 to number of items of questlist
  46.     if i > 51 then exit repeat
  47.     put item i of questlist into thisquest
  48.     go to card thisquest
  49.     -- ‚Ä¢‚Ä¢‚Ä¢ You can put the card # or the subelement #  or question #
  50.     -- as question #in key
  51.     put "#" & i into x -- question # option
  52.     -- put the short name of this card into x -- card # option
  53.     -- put first word of field "Q1" into x -- subelement # option
  54.     put first word of field "Q1" into y -- used for answer key
  55.     if i < 18 then
  56.       put sky1&x&"("&y&")"&return into sky1
  57.       put sky2&rightone&return into sky2
  58.     else if i < 35 then
  59.       put sky3&x&"("&y&")"&return into sky3
  60.       put sky4&rightone&return into sky4
  61.     else
  62.       put sky5&x&"("&y&")"&return into sky5
  63.       put sky6&rightone&return into sky6
  64.     end if
  65.   end repeat
  66.   go to card savedscores
  67.   put sky1 into field key1
  68.   put sky2 into field key2
  69.   put sky3 into field key3
  70.   put sky4 into field key4
  71.   put sky5 into field key5
  72.   put sky6 into field key6
  73.   -- prevent buildList from being called again immediately
  74.   put true into lockkey
  75.   go to first card
  76.   set lockscreen to false
  77. end buildList
  78.  
  79. on buildList1 -- ‚Ä¢‚Ä¢‚Ä¢ rename to buildList for sequential questions or to
  80.   -- buildList1 for randomly-generated questions
  81.   global questlist,rightone,lockkey,questans,questkey
  82.   global sky1, sky2, sky3, sky4, sky5, sky6 -- used for saved ans key
  83.   -- initialization
  84.   set the cursor to 4
  85.   -- ‚Ä¢‚Ä¢‚Ä¢ be sure that the group number of each question card matches the
  86.   -- question number.  For example, question #1 is group 1, question
  87.   -- #2 is group 2, and so on.
  88.   put empty into questlist
  89.   put empty into questans
  90.   put empty into questkey
  91.   put empty into sky1
  92.   put empty into sky2
  93.   put empty into sky3
  94.   put empty into sky4
  95.   put empty into sky5
  96.   put empty into sky6
  97.   set lockscreen to true
  98.   repeat with i = 1 to number of cards of bkgnd Test
  99.     put "#" & i & "," after questlist
  100.     put "," after questans
  101.     put "," after questkey
  102.   end repeat
  103.   delete last character of questlist
  104.   delete last character of questans
  105.   delete last character of questkey
  106.   -- ‚Ä¢‚Ä¢‚Ä¢ generate the answer key for these questions.  This currently
  107.   -- only works for first 32 questions
  108.   repeat with i = 1 to number of items of questlist
  109.     if i > 51 then exit repeat
  110.     put item i of questlist into thisquest
  111.     go to card thisquest
  112.     -- ‚Ä¢‚Ä¢‚Ä¢ You can put the card # or the subelement #  or question # -- as question #in key
  113.     -- put "#" & i into x -- question # option
  114.     put the short name of this card into x -- card # option
  115.     -- put first word of field "Q1" into x -- subelement # option
  116.     put first word of field "Q1" into y -- used for answer key
  117.     if i < 18 then
  118.       put sky1&x&"("&y&")"&return into sky1
  119.       put sky2&rightone&return into sky2
  120.     else if i < 35 then
  121.       put sky3&x&"("&y&")"&return into sky3
  122.       put sky4&rightone&return into sky4
  123.     else
  124.       put sky5&x&"("&y&")"&return into sky5
  125.       put sky6&rightone&return into sky6
  126.     end if
  127.   end repeat
  128.   go to card savedscores
  129.   put sky1 into field key1
  130.   put sky2 into field key2
  131.   put sky3 into field key3
  132.   put sky4 into field key4
  133.   put sky5 into field key5
  134.   put sky6 into field key6
  135.   -- prevent buildList from being called again immediately
  136.   put true into lockkey
  137.   go to first card
  138.   set lockscreen to false
  139. end buildList1
  140.  
  141.  
  142.  
  143. -- part 1 (button)
  144. -- low flags: 00
  145. -- high flags: 0000
  146. -- rect: left=111 top=169 right=309 bottom=228
  147. -- title width / last selected line: 0
  148. -- icon id / first selected line: 0 / 0
  149. -- text alignment: 1
  150. -- font id: 0
  151. -- text size: 12
  152. -- style flags: 0
  153. -- line height: 16
  154. -- part name: Exam
  155. ----- HyperTalk script -----
  156. on mouseDown
  157.   global username
  158.   ask "Please enter your name."
  159.   put it into username
  160.   put it into field "user" of card report
  161.   -- change unlimited to # minutes to put a time limit on test
  162.   -- be sure to change background of questions and below also.
  163.   answer "You have unlimited minutes to take this test" with "OK"
  164. end mouseDown
  165.  
  166. on mouseUp
  167.   global time1,score,check2,ok,questlist
  168.   set the cursor to 4
  169.   put empty into ok
  170.   put empty into score
  171.   put empty into check2
  172.   put empty into field QMissed of card report
  173.   get the long time
  174.   put it into field "Start" of Card "Report"
  175.   convert it to seconds
  176.   -- change 30 in next line to # of minutes desired for time limit
  177.   add 30*60 to it
  178.   put it into time1
  179.   -- put questlist into message -- for debug only
  180.   visual effect dissolve to black
  181.   visual effect dissolve
  182.   -- go card "#1" -- for debug only
  183.   get item 1 of questlist
  184.   go card it
  185. end mouseUp
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. -- part 2 (button)
  194. -- low flags: 00
  195. -- high flags: 0000
  196. -- rect: left=27 top=47 right=85 bottom=71
  197. -- title width / last selected line: 0
  198. -- icon id / first selected line: 1011 / 1011
  199. -- text alignment: 1
  200. -- font id: 0
  201. -- text size: 12
  202. -- style flags: 0
  203. -- line height: 16
  204. -- part name: Home
  205. ----- HyperTalk script -----
  206. on mouseUp
  207.   visual effect iris close
  208.   go home
  209. end mouseUp
  210.  
  211.  
  212.  
  213.  
  214. -- part 4 (button)
  215. -- low flags: 00
  216. -- high flags: 0000
  217. -- rect: left=431 top=55 right=94 bottom=472
  218. -- title width / last selected line: 0
  219. -- icon id / first selected line: 14767 / 14767
  220. -- text alignment: 1
  221. -- font id: 0
  222. -- text size: 12
  223. -- style flags: 0
  224. -- line height: 16
  225. -- part name: Tell Me About...
  226. ----- HyperTalk script -----
  227. on mouseUp
  228.   push this card
  229.   visual effect iris open
  230.   go to card "About...."
  231. end mouseUp
  232.